<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <%include("/common/header.html",{title:''}){}%>
    <title>安全设置</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" media="screen" href="css/login/style.css">
    <link rel="stylesheet" type="text/css" href="css/login/reset.css"/>
    <style>
        .layui-elem-quote {
            background-color: inherit !important;
        }

        .layui-input, .layui-select, .layui-textarea {
            background-color: inherit;
            padding-left: 30px;
        }

        #wxImg {
            display: none;
        }

        #movse:hover #wxImg {
            display: block;
        }

        #movse:hover #aa {
            color: #009688;
        }

        #wx {
            display: none;
        }

        #gzh:hover #wx {
            display: block;
        }

        #gzh:hover #bb {
            color: #009688;
        }
    </style>
</head>
<body>
<div class="x-nav" style="margin: 20px auto auto 15px;">
      <span class="layui-breadcrumb" lay-filter="breadcrumb" style="visibility: visible;">
        <a href="javascript:;">首页</a><span lay-separator="">/</span>
        <a href="javascript:;">系统设置</a><span lay-separator=""></span>
          <!--        <a><cite>安全设置</cite></a>-->
      </span>
    <a class="layui-btn layui-btn-primary layui-btn-small" style="margin: -5px 14px 0px 0px;float:right;"
       href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon layui-icon-refresh-3"></i>
    </a>
</div>

<form class="layui-form" action="" style="margin-top: 20px">



    <div class="layui-form-item">
        <label class="layui-form-label">账号:</label>
        <div class="layui-input-inline">
            <input type="text" name="phone" value="${session.om_user.phone}" readonly="readonly" lay-verify="required"
                   class="layui-input" style="width: 257%"
                   placeholder="请输入姓名">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">姓名:</label>
        <div class="layui-input-inline">
            <input type="text" name="name" value="${session.om_user.name}" lay-verify="required" class="layui-input"
                   style="width: 257%"
                   placeholder="请输入姓名">
        </div>
    </div>
    <!--    <div class="layui-form-item">-->
    <!--        <label class="layui-form-label">性别:</label>-->
    <!--        <div class="layui-input-inline">-->
    <!--            <input type="text" name="sex" value="${session.om_user.sex==0?'男':'女'}" readonly="readonly" lay-verify="required" value=""  class="layui-input" style="width: 257%"-->
    <!--                   placeholder="请输入姓名">-->
    <!--        </div>-->
    <!--    </div>-->
    <div class="layui-form-item">
        <label class="layui-form-label">手机:</label>
        <div class="layui-input-inline">
            <input type="text" name="mobile" maxlength="11" value="${session.om_user.mobile}" lay-verify="required"
                   class="layui-input" style="width: 257%"
                   placeholder="请输入手机号码">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">证件号:</label>
        <div class="layui-input-inline">
            <input type="text" name="idCard" lay-verify="required" value="${session.om_user.idCard}" maxlength="18"
                   class="layui-input" style="width: 257%"
                   placeholder="请输入证件号">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">所在区域:</label>
        <div class="layui-input-inline">
            <input type="text" name="address" lay-verify="required" value="${session.om_user.address}"
                   class="layui-input" style="width: 257%"
                   placeholder="所在区域">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">邮箱:</label>
        <div class="layui-input-inline">
            <input type="text" name="email" value="${session.om_user.email}" class="layui-input" style="width: 257%"
                   placeholder="请输入邮箱">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">开户行:</label>
        <div class="layui-input-inline">
            <input type="text" name="bankName" lay-verify="required" value="${session.om_user.bankName}"
                   class="layui-input" style="width: 257%"
                   placeholder="请输入开户行">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">银行卡号:</label>
        <div class="layui-input-inline">
            <input type="text" name="bankNum" lay-verify="required" value="${session.om_user.bankNum}"
                   class="layui-input" style="width: 257%"
                   placeholder="请输入银行卡号">
        </div>
    </div>

    <div class="layui-form-item" id="createTime">
        <label class="layui-form-label">注册时间:</label>
        <div class="layui-input-inline">
            <input type="text" name="createDate" readonly value="${session.om_user.createDate}" class="layui-input"
                   style="width: 257%">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">到期时间:</label>
        <div class="layui-input-inline">
            <input type="text" name="endTime" readonly value="${session.om_user.endTime}" class="layui-input"
                   style="width: 257%">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">管理员头像:</label>
        <div class="layui-input-inline">
            <button type="button" class="layui-btn" id="upload1">点击上传</button>
            <div class="layui-upload-list">
                <img class="layui-upload-img" width="100px" height="100px" id="img1" src="${isNotEmpty(session.om_user.image)?session.om_user.image:'static/layuiadmin/layui/img/carousel/01.jpg'}"/>
                <p id="demoText"></p>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="component-form-element">立即提交</button>
        </div>
    </div>
</form>
</body>
<%include("/common/foot.html"){}%>

<script>
    layui.use(['index', 'table', 'form', 'laydate', 'layedit', 'AjaxCommon', 'AliangLayui','jquery'], function () {
        var $ = layui.$;
        var form = layui.form;
        var laydate = layui.laydate;
        var AjaxCommon = layui.AjaxCommon;
        var AliangLayui = layui.AliangLayui;


        var update_url = 'system/passWord/updateInfo.jhtml';
        var index;//定义建立富文本编辑器全局变量
        var layedit//定义富文本编辑器layedit全局变量


        layui.use('upload', function () {
            var $ = layui.jquery, upload = layui.upload;
            var uploadInst = upload.render({
                elem: '#upload1',
                auto: false,
                choose: function (obj) {
                    obj.preview(function (index, file, result) {//预读本地文件示例，不支持ie8
                        console.log(JSON.stringify(obj));
                        console.log(JSON.stringify(file));
                        $('#img1').attr('src', result); //图片链接（base64）
                    });

                }
            });
        });

        form.on('submit(component-form-element)', function (data) {
            // data.field.introduce = layedit.getContent(index);
            alert(JSON.stringify(data.field))
            // var name = data.field.name;
            // var idCard = data.field.idCard;
            // var mobile = data.field.mobile;
            // var address = data.field.address;
            // var email = data.field.email;
            // var bankName = data.field.bankName;
            // var bankNum = data.field.idCard;
            var formData = new FormData();
            formData.append("data",JSON.stringify(data.field));
            formData.append("file",$("input[name='file']")[0].files[0])
            $.ajax({
                url: update_url,
                type: "POST",
                data: formData,
                processData: false,
                contentType: false,
                success: function (ret) {
                    layer.msg("修改成功", {
                        icon: 6
                    });
                    window.location.reload();
                },
                error: function (jqXHR, textStatus, errorThrown) {
                    var estr = "Page:" + window.location.pathname + ",Function: postDelete()";
                    layer.open({
                        title: "错误信息",
                        area: ['100%', '100%'],
                        type: 2,
                        content: "base/error.jhtml?info=" + estr, //
                        btn: ['关闭'] //可以无限个按钮
                    });
                }
            });

            return false;
        });
        //头工具栏事件

    });
</script>

</html>